from jsonpath_rw import parse

def get_data(data,key):
    json_data=parse(key)
    madle=json_data.find(data)
    for math in madle:
        return math.value




if __name__=="__main__":
    data={
        "a":"a1",
        "b":"b1",
        "c":[
            {"d":"d1"},
            {"d":"d2"},
            {"d":"d3"},
            ]
    }
    key="c.[1].d"
    print(get_data(data,key))